package com.db4ospatial.geom;

import com.vividsolutions.jts.geom.Coordinate;

/**
 * Wrapper for com.vividsolutions.jts.geom.Coordinate
 * 
 * @author pablo
 *
 */
public class Coordinate4
{
	private Coordinate coordinate;
	
	public Coordinate4(){
		coordinate = new Coordinate();
	}
	
	public Coordinate4(com.vividsolutions.jts.geom.Coordinate c){
		coordinate = new Coordinate(c);
	}
	
	public Coordinate4(Coordinate4 c){
		coordinate = new Coordinate( c.getJTSCoordinate() );
	}
	
	public Coordinate4(double x, double y, double z){
		coordinate = new Coordinate(x, y, z);
	}
	
	public Coordinate4(double x, double y){
		coordinate = new Coordinate(x, y);
	}
	
	public Object clone(){
		return coordinate.clone();
	}
	
	public double distance(Coordinate4 c){
		return coordinate.distance(c.getJTSCoordinate());
	}
	
	public double distance(Coordinate c){
		return coordinate.distance(c);
	}
	
	public boolean equals(Object o){
		return coordinate.equals(o);
	}
	
	public boolean equals2D(Coordinate4 c){
		return coordinate.equals2D(c.getJTSCoordinate());
	}
	
	public boolean equals2D(Coordinate c){
		return coordinate.equals2D(c);
	}
	
	public boolean equals3D(Coordinate4 c){
		return coordinate.equals3D(c.getJTSCoordinate());
	}
	
	public boolean equals3D(Coordinate c){
		return coordinate.equals3D(c);
	}
	
	public int compareTo(Object o){
		return coordinate.compareTo(o);
	}
	
	public int hashCode(){
		return coordinate.hashCode();
	}
	
	public static int hashCode(double x){
		return Coordinate.hashCode(x);
	}
	
	public void setCoordinate(Coordinate src){
		coordinate.setCoordinate(src);
	}
	
	public void setCoordinate(Coordinate4 src){
		coordinate.setCoordinate(src.getJTSCoordinate());
	}
	
	public String toString(){
		return coordinate.toString();
	}
	
	public Coordinate getJTSCoordinate(){
		return coordinate;
	}
	
}
